package email

import (
	"github.com/jordan-wright"
	"net/smtp"
)

func SendEmail(to string, files []string) error {

	e := email.NewEmail()
	e.From = "yasenagat@163.com"
	e.To = []string{to}
	for _, f := range files {
		e.AttachFile(f)
	}
	e.Cc = []string{"200601227@qq.com"}
	e.Subject = "【daminghu-cli】生成的可运行、可演示的[项目]"
	e.HTML = []byte("<h1>【daminghu-cli】生成的可运行、可演示的[项目]</h1><h1>项目源码生成工具，生成前后分离的两个项目源码</h1>" +
		"<h2>项目源码生成工具，生成前后分离的两个项目源码，一个服务端(golang,beego)项目，一个web(vue 2.0,vue router,element ui)项目。<h2><b>https://gitee.com/godY/daminghu-cli</b>")
	return (e.Send("smtp.163.com:25", smtp.PlainAuth("20151011yiyi", "yasenagat@163.com", "20151011yiyi", "smtp.163.com")))
}
